<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript">
	function onclickSee() {
		var url = "equSwitch_switchList.action";
		var equNos = document.getElementById('equNos').value;
		// var nos =encodeURI(encodeURI(equNos));
		url += "?equNos=" + equNos;
		$.pdialog.closeCurrent();//关闭当前活动层
		navTab.openTab("showEquSwitch", url,{ title:"查看考勤列表", fresh:false, data:{} });
		// location.href='equSwitch_list?equNos='+equNos;
	}
	
	function checkLength() {
		
		var remarkValue = document.getElementById("remarkId").value;
		var length = remarkValue.length;
		var a = 0;
		for ( var i = 0; i < remarkValue.length; i++) {
			if (remarkValue.charCodeAt(i) > 127) {
				length++;
			}
			if(length<=200){
				a = i;
			}
		}
		
		if (length >= 200) {
			document.getElementById("remarkId").value = remarkValue.substr(
					0, a);
			document.getElementById("showWarn").innerHTML = "您的备注输入已经超过200字符！";
		}else{
			document.getElementById("showWarn").innerHTML ="";
		}
	}
</script>
<div class="pageContent">
	<form method="post" action="equSwitch_add.action"
		class="pageForm required-validate" id="myForm"
		onsubmit="return validateCallback(this, navTabAjaxDone);">
		<div class="pageFormContent" layoutH="59">
			<div class="unit">
				<label>设备编号：</label> <input id="equNos" name="equNos" type="text"
					value="${equNos}" readonly="true" />
			</div>
			<div class="unit">
				<label>开始时间：</label> <input id="startTime" type="text"
					name="startTime" class="date required" dateFmt="HH:mm" readonly="true" /> <a
					class="inputDateButton" href="javascript:;">选择</a> <span
					class="info">HH:mm</span>
					<span class="inputInfo">* 注:必填字段</span><span id="showWarnw" style="color:red"></span>
				<!-- <input name="equSwitch" type="text"  /><span id="starttimem"></span>-->
			</div>
			<div class="unit">
				<label>结束时间：</label> <input type="text" name="endTime" class="date"
					dateFmt="HH:mm" readonly="true" /> <a class="inputDateButton"
					href="javascript:;">选择</a> <span class="info">HH:mm</span>
			</div>
			<div class="unit">
				<label>备注信息：</label>
				<textarea id="remarkId"  cols="38" name="remark" rows="6" onkeyup="checkLength();" onblur="checkLength();"></textarea>
				<span class="inputInfo">* 注:100个汉字以内</span>
			</div>
			<div><span id="showWarn" style="color:red"></span></div>
			
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit" >保存</button>
						</div>
					</div></li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" onclick="onclickSee();">检索</button>
						</div>
					</div>
				</li>
				<li>
				<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
